#ifndef _FUNCTION_H_
#define _FUNCTION_H_

#include "main.h"

/*	function in function.cpp	*/
extern int PORT_START ;
extern int port_scan(int protol) ;
extern int get_free_port(int proto) ;
extern char *ip_ntoa(const unsigned char * ip) ;
extern void create_server_sokect(int sockfd, int port) ;
extern int create_client_socket(int sockfd, int port, std::string ip) ;
extern int find_port_from_vlan(int vlanId) ;
extern int add_bridge(int br_flag);
extern int del_bridge(int br_flag);//add by zzl 20151224
extern int add_vlan(std::string inface_name,int vid) ;
extern int del_vlan(std::string inface_name, int vid);//add by zzl 20151127
extern int add_inface_to_bridge(int br_flag, std::string vlan_name) ;
extern bool make_inface_up(std::string vlan_name );
extern int file_exists(const char * filename) ;
extern int mac_verify(const char * macaddr) ;
extern int mac_check_allFF(const char * macaddr) ;
extern int mac_aton(const char *mac, unsigned char addr[]) ;
extern char * Trim(char src[]) ;
extern int check_ip (char ip[]) ;
extern int IsSubnetMask(char* subnet) ;
extern bool getInterfaceStatus(std::string inface);
extern unsigned char * IterfaceIpQuery(void);
extern int TransmitByte(void);
extern int ReciveByte(void);
extern int Qurey4GSignal(void);
extern bool getInterfaceStatusAnotherWay(std::string inface) ;
extern char *getBroadIp(const char ip[], const char netmask[]);
extern char *getSubnet(const char ip[], const char netmask[]);
extern int getPidOfVlan(int vlanid,int flag);
extern int killVlanProgress(int pid);
extern int vlanModifieAction(int vlanid,int port, int flag);
extern int device_wan_ip_set_fun(int workmode);
extern int get_ip_mask(const char *ifname, char *Ipaddr, char *mask);
extern int get_gateway(const char *ifname, char *gateway);


extern int table_C0_vpn_handle_func(struct userType *item_data);
extern int table_C2_provlan_handle_func(struct userType *item_data);
extern int table_CA_force_handle_func(struct userType *item_data);

#endif

